#include <math.h>
#include <stdio.h>

struct _dbl_t {
	unsigned __int64 significand : 52;
	unsigned __int64 exponent : 11;
	unsigned __int64 sign : 1;
};

double calc(struct _dbl_t dbl)
{
	double m = 0;
	int i;

	if (dbl.exponent == 0 && dbl.significand == 0) {
		m = 0;
	}
	else {
		for (i = 0; i < 52; i++) {
			if (dbl.significand & ((__int64)1 << i)) {
				m += pow((double)2, (double)(-52 + i));
			}
		}

		m = 1 + m;
		m = m * pow((double)2, (double)dbl.exponent - 1023);
	}

	if (dbl.sign) {
		m = -m;
	}

	return m;
}

int main()
{
	double d0, d1;
	struct _dbl_t *p = (struct _dbl_t *)&d0;
	p->sign = 0;
	p->exponent = 0;
	p->significand = 0;

	d1 = calc(*p);
	puts(d0 == d1? "equal" : "diff");
}

